﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace PInitiatives.Models
{
    public partial class Review
    {
        public Review() { }
        public Review(int ratingUserId, int authorId, int initiativeId, int authorRate, int initativeRate, string description)
        {
            this.RatingUserID = ratingUserId;
            this.AuthorID = authorId;
            this.InitiativeID = initiativeId;
            this.AuthorRate = authorRate;
            this.InitiativeRate = initativeRate;
            this.Description = description;
            this.CreateDate = DateTime.Now;
        }

        public string RateType
        {
            get { return GetInitativeViewType(); }
        }

        private string GetInitativeViewType()
        {
            if (this.InitiativeRate == -1)
                return "Za udział";
            else
                return "Autor";
        }

        public string InitiativeViewRate
        {
            get { return GetInitativeViewRate(); }
        }

        private string GetInitativeViewRate()
        {
            if (this.InitiativeRate == -1)
                return "(ocena za udział)";
            else
                return InitiativeRate.ToString();
        }
    }
}